package com.cxso.example.client;

import com.cxso.example.enums.ProductClientEnum;
import com.cxso.example.request.location.LocationVnoIsNetRequest;
import com.cxso.example.request.location.LocationVnoRouterPathRequest;
import com.cxso.example.request.location.LocationVnoTransTimeManageRequest;
import com.cxso.example.response.location.LocationVnoIsNetResponse;
import com.cxso.example.response.location.LocationVnoRouterPathResponse;
import com.cxso.example.response.location.LocationVnoTransTimeManageResponse;
import com.cxso.example.sdk.domain.Result;
import com.cxso.example.sdk.http.base.HttpMethod;
import com.cxso.example.sdk.http.client.Client;
import com.cxso.example.sdk.http.core.ChoiceClient;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = "车辆定位服务")
public class LocationClient extends Client {

    public LocationClient(ChoiceClient choiceClient) {
        super(choiceClient);
    }

    @Schema(description = "车辆入网查询")
    public Result<LocationVnoIsNetResponse> locationVnoIsNet(LocationVnoIsNetRequest locationVnoIsNetRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/location/selectIsNet", HttpMethod.POST, locationVnoIsNetRequest).toEntity(LocationVnoIsNetResponse.class);
    }

    @Schema(description = "运输节点查询:实时位置")
    public Result<LocationVnoTransTimeManageResponse> locationVnoTransTimeManage(LocationVnoTransTimeManageRequest locationVnoTransTimeManageRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/location/selectTransTimeManage", HttpMethod.POST, locationVnoTransTimeManageRequest).toEntity(LocationVnoTransTimeManageResponse.class);
    }
 
    @Schema(description = "运输行程服务:历史轨迹")
    public Result<LocationVnoRouterPathResponse> locationVnoRouterPath(LocationVnoRouterPathRequest locationVnoRouterPathRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/location/selectRouterPath", HttpMethod.POST, locationVnoRouterPathRequest).toEntity(LocationVnoRouterPathResponse.class);
    }
}
